<#include "common/main.html">
<#macro bodyId>right-mg</#macro>
<#macro content>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ty-common-page">
    <h1 class="page-header">${name}权限
	    <div class="btns">
	        <a class="btn btn-primary" href="${rc.contextPath}/priviledge/list">返回功能角色列表</a>
	    </div>
    </h1>
    <div class="table-responsive">
        <form class="form-horizontal ac-form J_acXHRForm" method="post" action="${rc.contextPath}/priviledge/addOrUpdate">
            <input name="roleId" type="hidden" value="${roleId}">
            <div class="form-group">
                <label class="col-sm-2 control-label required">角色名称：</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control ac-form-item" placeholder="" required name="roleName" value="${roleName}">
                </div>
            </div>
            <#assign rootMenuActionList = actionMap.get('rootMenuActionList')/>
            <#if rootMenuActionList??&&(rootMenuActionList!='')>
            <#list rootMenuActionList as rootMenuAction>
                <#if rootMenuAction??>
                    <div class="level-1">
                        <h1 class="level-1-name">
                            <label class="checkbox-inline">
                                <input type="checkbox" name="actionIdArr" <#if priviledgeMap.get(rootMenuAction.id)??>checked="checked"</#if> value="${rootMenuAction.id}">${rootMenuAction.name}
                            </label>
                        </h1>
                        <#assign subMenuActionList = actionMap.get('subMenuActionMap').get(rootMenuAction.id)/>
                        <#if subMenuActionList??&&(subMenuActionList!='')>
	                        <div class="level-1-wrap">
	                        <#list subMenuActionList as subMenuAction>
	                            <div class="level-2">
	                                <h1 class="level-2-name">
	                                    <label class="checkbox-inline">
	                                        <input type="checkbox" name="actionIdArr" <#if priviledgeMap.get(subMenuAction.id)??>checked="checked"</#if> value="${subMenuAction.id}"> ${subMenuAction.name}
	                                    </label>
	                                </h1>
                                    <#assign leafMenuActionList = actionMap.get('leafActionMap').get(subMenuAction.id)/>
                                    <#if leafMenuActionList??&&leafMenuActionList!=''>
		                                <div class="level-2-wrap">
		                                <#list leafMenuActionList as action>
		                                    <label class="checkbox-inline">
		                                        <input type="checkbox" name="actionIdArr" <#if priviledgeMap.get(action.id)??>checked="checked"</#if> value="${action.id}"> ${action.name}<#if action.aliasName??>(${action.aliasName})</#if>
		                                    </label>
		                                </#list>
		                                </div>
	                                </#if>
	                            </div>
	                        </#list>
	                        </div>
	                   </#if>
                    </div>
                </#if>
            </#list>
            </#if>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>        
        </form>
    </div>
</div>

<script>
    var config = {};
</script>
</#macro>